package com.xiangxiao.rpan.storage.anotion.impl;

import com.xiangxiao.rpan.storage.anotion.StorageParamItem;
import com.xiangxiao.rpan.storage.anotion.StorageParamSelect;
import com.xiangxiao.rpan.storage.entity.StorageSourceParamDef;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/11/10 14:52
 */
public class EncodingStorageParamSelect implements StorageParamSelect {
  @Override
  public List<StorageSourceParamDef.Options> getOptions(StorageParamItem storageParamItem, Object targetParam) {
    List<StorageSourceParamDef.Options> options = new ArrayList<>();

    for (String name : Charset.availableCharsets().keySet()) {
      StorageSourceParamDef.Options option = new StorageSourceParamDef.Options(name);
      options.add(option);
    }
    return options;
  }
}
